using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WinXMLNodes
{
    public partial class WinXml : Form
    {
        private XmlExample example = new XmlExample();
        private List< CPersona> persones;
        public WinXml()
        {
            InitializeComponent();
        }

        private void WinXml_Load(object sender, EventArgs e)
        {

        }

        private void btnCreate_Click(object sender, EventArgs e)
        {
            example.CreateXml();
        }

        private void btnLoad_Click(object sender, EventArgs e)
        {
            persones=example.LoadXml();
            this.dataGridView1.DataSource = persones;
            this.dataGridView2.DataMember = "Direccions";
            this.dataGridView2.DataSource = persones;
            this.dataGridView3.DataMember = "Telefons";
            this.dataGridView3.DataSource = persones;

        }
    }
}